@extends('admin.layout.index')
@section('content')
    <div class="mws-panel grid_8">
        <div class="mws-panel-header">
            <span><i class="icon-table"></i> Data Table with Numbered Pagination</span>
        </div>
        <div class="mws-panel-body no-padding">
            <div id="DataTables_Table_1_wrapper" class="dataTables_wrapper" role="grid">
                <form action="/admin/good" method="get">

                    {{--分页--}}
                    <div id="DataTables_Table_1_length" class="dataTables_length">
                        <label>
                            {{--分页--}}
                            {{--<select size="1" name="page" aria-controls="DataTables_Table_1" >--}}
                                {{--<option value="2" selected="selected">10</option>--}}
                                {{--<option value="5">25</option>--}}
                                {{--<option value="100">50</option>--}}
                            {{--</select>--}}
                            <select name="count" aria-controls="DataTables_Table_1">
                                <option value="2" @if(!empty($request['count']) && $request['count'] == 2) selected @endif>2</option>
                                <option value="5" @if(!empty($request['count']) && $request['count'] == 5) selected @endif>5</option>
                                <option value="10" @if(!empty($request['count']) && $request['count'] == 10) selected @endif>10</option>

                            </select>
                            种类
                            <select size="1" name="gcid" aria-controls="DataTables_Table_1" style="width:300px;" >


                                {{--@foreach($s as $k=>$v)--}}
                                    {{--<option value="{{$v['cid']}}"{{$data['g_cid']==$v['cid']? 'selected':''}}>{{$v['cname']}}</option>--}}
                                {{--@endforeach--}}
                                <option value="">商品类</option>
                                    @foreach($s as $k=>$v)

                                        <option value="{{$v['cid']}}">{{$v['cname']}}</option>
                                    @endforeach

                            </select>

                        </label>
                    </div>
                    {{--搜索--}}
                    <div class="dataTables_filter" id="DataTables_Table_1_filter">
                        <label>Search: <input type="text" aria-controls="DataTables_Table_1" name="search"></label>
                        <input type="submit" value="提交">
                    </div>

                </form>



                <table class="mws-datatable-fn mws-table dataTable" id="DataTables_Table_1" aria-describedby="DataTables_Table_1_info">
                    <thead>
                    <tr>
                        <th>id</th>
                        <th>商品所属分类</th>
                        <th>商品名称</th>
                        <th>商品价格</th>
                        <th>商品库存</th>
                        <th>商品缩略图</th>
                        <th>商品描述</th>
                        <th>操作</th>
                    </tr>
                    </thead>

                    <tbody role="alert" aria-live="polite" aria-relevant="all">
                    @foreach($data as $k=>$v)
                    <tr class="odd">
                        <td class=" sorting_1">{{$v['gid']}}</td>
                        <td class=" ">{{$v['cname']}}</td>
                        <td class=" ">{{$v['gname']}}</td>
                        <td class=" ">{{$v['gcost']}}</td>
                        <td class=" ">{{$v['gnum']}}</td>
                        <td class=" ">
                            <img src="http://lamp187mall.oss-cn-beijing.aliyuncs.com/{{$v['gphoto']}}" style="height:30px">
                        </td>
                        <td class=" ">{{$v['gcontent']}}</td>
                        <td align="center">
                            <a href="/admin/good/delete/{{$v['gid']}}">删除</a>
                            <a href="/admin/good/{{$v['gid']}}/edit">修改</a>
                            <a href="">查看商品详情</a>

                        </td>
                    </tr>
                        @endforeach
                   </tbody>
                </table>
                <div id="page_page" class="">
                    {!! $data->appends($request)->render()!!}
                </div>
                </div>
            </div>
        </div>

@endsection